package com.whu.service.impl;

import com.whu.UVAProtocol.UVAConnection;
import com.whu.UVAProtocol.UVAServer;
import com.whu.aircraft.Aircraft;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class AircraftService {
    public List<Aircraft> getAircraft() {
        List<Aircraft> airCrafts = new ArrayList<>();
        for(UVAConnection cnt:UVAServer.uvaConnections.values()){
            airCrafts.add(cnt.getAircraft());
        }
        return airCrafts;
    }
    public Aircraft getAircraftById(int id){
        Aircraft aircraft = UVAServer.uvaConnections.get(id).getAircraft();
        return aircraft;
    }
}
